package com.zangs.emqx_expand.emqx.domain;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.zangs.emqx_expand.common.annotation.Excel;
import com.zangs.emqx_expand.common.core.domain.BaseEntity;

import javax.validation.constraints.NotNull;

/**
 * MQTT 在线用户对象 mqtt_user_online
 * 
 * @author zangs
 * @since 2025-01-26
 */
public class MqttUserOnline extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 唯一标识符 */
    private Long id;

    /** 用户ID */
    @Excel(name = "用户ID")
    @NotNull
    private Long userId;

    /** 客户端ID */
    @Excel(name = "客户端ID")
    @NotNull
    private String clientId;

    /** 是否在线 */
    @Excel(name = "是否在线")
    @NotNull

    private Boolean online;

    /** 用户唯一标识（第三方唯一uid） */
    @Excel(name = "用户唯一标识", readConverterExp = "第=三方唯一uid")
    @NotNull

    private String deviceUid;

    /** 用户唯一标识 */
    @Excel(name = "用户唯一标识")
    @NotNull

    private String userUid;

    public void setId(Long id) 
    {
        this.id = id;
    }

    public Long getId() 
    {
        return id;
    }
    public void setUserId(Long userId)
    {
        this.userId = userId;
    }

    public Long getUserId()
    {
        return userId;
    }
    public void setClientId(String clientId) 
    {
        this.clientId = clientId;
    }

    public String getClientId() 
    {
        return clientId;
    }
    public void setOnline(Boolean online)
    {
        this.online = online;
    }

    public Boolean getOnline()
    {
        return online;
    }
    public void setDeviceUid(String deviceUid) 
    {
        this.deviceUid = deviceUid;
    }

    public String getDeviceUid() 
    {
        return deviceUid;
    }
    public void setUserUid(String userUid) 
    {
        this.userUid = userUid;
    }

    public String getUserUid() 
    {
        return userUid;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("userId", getUserId())
            .append("clientId", getClientId())
            .append("online", getOnline())
            .append("deviceUid", getDeviceUid())
            .append("userUid", getUserUid())
            .toString();
    }
}
